<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>公告分类管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
		function delFunc(id){
			var param="id="+id;
			$.ajax({
				url:"${ctx}/sys/system/announcementGroup/announcementGroupByAnnouncement?"+param,
				success:function(result){
					if(result){
						showTip("该公告分类下存在公告信息，不能删除！",'',3000,0);
						return;
					}else{
						confirmx('确认要删除该公告分类吗?','${ctx}/sys/system/announcementGroup/delete?'+param);
					}
				}
			});
		}
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/sys/system/announcementGroup/">公告分类列表</a></li>
		<shiro:hasPermission name="sys:announcementGroup:edit"><li><a href="${ctx}/sys/system/announcementGroup/form">添加</a></li></shiro:hasPermission>
	</ul>
	 <form:form id="searchForm" modelAttribute="announcementGroup" action="${ctx}/sys/system/announcementGroup/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<%-- <ul class="ul-form">
			<li><label>公告类别：</label>
				<form:input path="title" htmlEscape="false" maxlength="100" class="input-medium" />
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul> --%>
	</form:form> 
	<div style="display:none;">
		<sys:message content="${message}"/>
	</div>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>序号</th>
				<th>公告类别</th>
				<th>描述</th>
				<shiro:hasPermission name="sys:announcementGroup:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="announcementGroup" varStatus="stats">
			<tr>
				<td>${stats.index+1}</td>
				<td><a href="${ctx}/sys/system/announcementGroup/form?id=${announcementGroup.id}">
					${announcementGroup.title}
				</a></td>
				<td>
					${announcementGroup.remarks}
				</td>
				<shiro:hasPermission name="sys:announcementGroup:edit"><td>
    				<a href="${ctx}/sys/system/announcementGroup/form?id=${announcementGroup.id}">编辑</a>
    				<a href="javascript:;" onclick="delFunc('${announcementGroup.id}')">删除</a>
					
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>